Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-extendable

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-extendable

Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?"

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21M
decreased by-57.64%
Maintainers
1
Weekly downloads
 
Created

What is is-extendable?

The is-extendable npm package is used to check if a value is extendable, meaning if it can have new properties added to it. This is typically used in the context of extending objects in JavaScript, where certain types of values, like null or undefined, cannot be extended.

What are is-extendable's main functionalities?

Checking if an object is extendable

This feature allows you to check if a given value is an object or function that can have new properties added to it. It returns true for plain objects and functions, and false for non-extendable values like null, undefined, and primitives.

const isExtendable = require('is-extendable');

// Returns true for plain objects
console.log(isExtendable({})); // true

// Returns true for functions
console.log(isExtendable(function() {})); // true

// Returns false for non-extendable values
console.log(isExtendable(null)); // false
console.log(isExtendable(undefined)); // false
console.log(isExtendable(123)); // false

Other packages similar to is-extendable

Keywords

FAQs

Package last updated on 04 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc